package com.google.code.motoo.codec.http;

import com.google.code.motoo.codec.ProtocolCodecFactory;
import com.google.code.motoo.codec.ProtocolDecoder;
import com.google.code.motoo.codec.ProtocolEncoder;
import com.google.code.motoo.codec.textline.LineDelimiter;

public class HttpCodecFactory implements ProtocolCodecFactory {
	
	private String charset;
	private LineDelimiter delimiter;
	
	public HttpCodecFactory(String charset) {
		this(charset, LineDelimiter.WINDOWS);
	}
	
	public HttpCodecFactory(String charset, LineDelimiter delimiter) {
		this.charset = charset;
		this.delimiter = delimiter;
	}

	public ProtocolDecoder getDecoder() {
		return new HttpDecoder(charset, delimiter);
	}

	public ProtocolEncoder getEncoder() {
		return new HttpEncoder(charset, delimiter);
	}

}
